package com.tencreat.service.account;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tencreat.common.core.HttpResult;
import com.tencreat.common.core.domain.entity.SysUser;
import com.tencreat.common.core.domain.model.ReqIdParam;
import com.tencreat.common.core.domain.model.ReqIdsParam;
import com.tencreat.domain.account.MallSupplier;
import com.tencreat.domain.account.dto.MallSupplierRequDTO;
import com.tencreat.domain.account.dto.MallSupplierDTO;
import com.tencreat.domain.account.vo.MallSupplierRespVo;
import com.tencreat.domain.account.vo.MallSupplierStaticsVo;
import com.tencreat.domain.mall.dto.MallSupplierAuditDTO;

import java.util.List;

/**
 * 供应商Service接口
 *
 * @author tencreat
 * @date 2021-08-13
 */
public interface IMallSupplierService extends IService<MallSupplier> {
	/**
	 * 查询用供应商
	 *
	 * @param id 供应商ID
	 * @return 供应商
	 */
	public MallSupplier selectMallSupplierById(ReqIdParam id);

	/**
	 * 查询用供应商
	 *
	 * @param id 供应商ID
	 * @return 供应商
	 */
	public MallSupplier selectMallSupplierById(Long id);

	/**
	 * 查询供应商列表
	 *
	 * @param mallSupplier 供应商
	 * @return 供应商集合
	 */
	public List<MallSupplier> selectMallSupplierList(MallSupplier mallSupplier);

	/**
	 * 新增供应商
	 *
	 * @param mallSupplierVO 供应商
	 * @return 结果
	 */
	public HttpResult<String> insertMallSupplier(MallSupplierDTO mallSupplierVO);

	/**
	 * 审核供应商
	 * @param id 供应商ID
	 * @param passed 是否审核通过
	 * @return 结果
	 */
	public HttpResult<String> auditMallSupplier(ReqIdParam id, Boolean passed);

	/**
	 * 重置登录密码
	 */
	HttpResult<Boolean> password(MallSupplierRequDTO mallSupplier);

	/**
	 * 修改供应商
	 *
	 * @param mallSupplier 供应商
	 * @return 结果
	 */
	public HttpResult<String> updateMallSupplier(MallSupplier mallSupplier);

	/**
	 * 批量删除用户
	 *
	 * @param ids 需要删除的用户ID
	 * @return 结果
	 */
	public int deleteMallSupplierByIds(ReqIdsParam ids);

	/**
	 * 删除用户信息
	 *
	 * @param id 用户ID
	 * @return 结果
	 */
	public int deleteMallSupplierById(ReqIdParam id);

	/**
	 * 供应商审核
	 * @param dto 入参
	 */
	void audit(MallSupplierAuditDTO dto);

	/**
	 * 生成用户唯一UUID
	 * @return 用户唯一ID
	 */
	int generateUUID();

	MallSupplierStaticsVo supplierStatics();

	IPage<MallSupplierRespVo> queryAll(Page<MallSupplier> page, MallSupplier supplier);

    Long selectApprovalStatus(Long uuid);

	SysUser insertSysUser(MallSupplier supplier, String pass);


	List<MallSupplier> selectByUserName(String userName);
}
